<%-- 
    Document   : moviepane
    Created on : Jul 28, 2012, 8:16:25 PM
    Author     : Atienza-Home
--%>

<%@page import="Factory.Tables.Movie"%>
<%@page import="Factory.Tables.User" %>
<%@page import="Functions.ProgramFunction"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%
 
    Movie movie = (Movie)session.getAttribute("movie");
    User user = (User)session.getAttribute("user");
   
 

%>
<%if(user != null){%>
<div id="modalpopuppane" style="display:none;">
    <%@include file="cartmodalpopup.jsp" %>
</div>
<%}%>
<div class="specificmovielist" style="width: 890px;margin:auto;">
    <div id="movielist"  style="height: 338px;">
        <div id="moviepic<%=movie.getId()%>" style="float:left;line-height: 12px;">
            <img src="images/movie/<%=movie.getMoviePic()%>" style="width:208px;height: 303px;" ><br>
            <%
            if(movie.getInventoryQuantity()!=0){
            %>
            <%if(user==null){%>
            <a id="abuymovie" onmouseout="javascript:buymovieout()" onmouseover="javascript:buymovieover()" onclick="location.href='login.jsp?idmovie=<%=movie.getId()%>&idcategory=0&basepage=0'" href="#" ><div id="buymovie" style="background-color:#006666;width:203px;height: 25px;padding-left: 5px;padding-top: 10px;"><font color="white">Add to Cart!</font></div></a>
            <%}else{%>
            <a id="abuymovie" onmouseout="javascript:buymovieout()" onmouseover="javascript:buymovieover()" href="javascript:cartmodalpopup()"><div id="buymovie" style="background-color:#006666;width:203px;height: 25px;padding-left: 5px;padding-top: 10px;"><font color="white">Add to Cart!</font></div></a>    
                
            <%}%>
            <%
            }else{
            %>
            <div id="buymovie" style="background-color:gray;width:203px;height: 25px;padding-left: 5px;padding-top: 10px;"><font color="black">Add to Cart!</font></div>
            <%
            }
            %>
            
            
        </div>
        <div id="moviedetails<%=movie.getId()%>" style="float:left;width: 642px;height: 263px;padding: 20px;text-align: center;" >
            
            <%
            if(movie.getInventoryQuantity()<=10&&movie.getInventoryQuantity()>0){
                            
                %>
                <font color="#cc6666">Hurry while supplies last!</font>
                <%                          
            }else if(movie.getInventoryQuantity()==0){
                %>
                <font color="#cc6666">Out of stock!</font>
                <%
            }
            %>
            <br>
            <font color="white" size="5px" style="font-family: arial"><%=movie.getName()%></font><br>
            <font color="white"><%=movie.getDescription()%></font><br>
            <font color="white" size="5px" style="font-family: arial;font-weight: bold;">P<%=movie.getPrice()%></font><br><br>
            <div id="starrating" style="width:141px;margin:auto;">
                <img src="images/movie/starnocolor.png" id="star1" onmouseout="javascript:starout()" onmouseover="javascript:starover(1)" onclick="javascript:starclick(1,'<%=movie.getId()%>')" width="25px" height="24px">
                <img src="images/movie/starnocolor.png" id="star2" onmouseout="javascript:starout()" onmouseover="javascript:starover(2)" onclick="javascript:starclick(2,'<%=movie.getId()%>')" width="25px" height="24px">
                <img src="images/movie/starnocolor.png" id="star3" onmouseout="javascript:starout()" onmouseover="javascript:starover(3)" onclick="javascript:starclick(3,'<%=movie.getId()%>')" width="25px" height="24px">
                <img src="images/movie/starnocolor.png" id="star4" onmouseout="javascript:starout()" onmouseover="javascript:starover(4)" onclick="javascript:starclick(4,'<%=movie.getId()%>')" width="25px" height="24px">
                <img src="images/movie/starnocolor.png" id="star5" onmouseout="javascript:starout()" onmouseover="javascript:starover(5)" onclick="javascript:starclick(5,'<%=movie.getId()%>')"  width="25px" height="24px">
                
                           
            </div>
            <div id="ratingdiv">
                <div id="starloader"></div>    
            <font color="white" style="font-size:12px">Rating: <%=movie.getRating()%></font>
            </div>
            <br><br>
            
                <font color="white">Release Date: <%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie.getReleaseDate().toString()) %></font><br>
            
            
                        
                        
            
                        
                        
                        
                        
                        
                        
        </div>
    </div>
                
                
                
    
    
</div>
